package com.example.teaknower.activity;
import android.view.View;
import android.widget.Button;
import com.example.teaknower.R;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import java.util.Timer;
import java.util.TimerTask;


public class WelcomeAcitvity extends AppCompatActivity {

    private int recLen = 3;
    private Button button;
    Timer timer = new Timer();
    private Handler handler;
    private Runnable runnable;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome_acitvity);



        handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                //执行在主线程
                //启动主页面
                startActivity(new Intent(WelcomeAcitvity.this, MainActivity.class));
                //关闭当前页面
                finish();
            }
        }, 1000);
    }




}

